﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Web;
using System.Web.Caching;
using Xmobile.DB;

namespace Xmobile.BO.Category
{
    public class CategoryBO
    {
        public static DataTable Category_Select_by_CatID(int CatID)
        {
            string cacheName = SQLCache.CacheNameFormat.Category_Select_by_CatID(CatID);
            DataTable __result = null;
            __result = (DataTable)HttpContext.Current.Cache[cacheName];
            if (__result != null) return __result;

            using (MainDB db = new MainDB())
            {
                __result = db.StoredProcedures.Category_Select_by_CatID(CatID);
                db.Close();
                db.Dispose();
            }

            System.Web.Caching.SqlCacheDependency __sqlDep = new SqlCacheDependency("Xmobile", "ContentCrawler");
            HttpContext.Current.Cache.Insert(cacheName, __result, __sqlDep);

            return __result;
        }
    }
}
